<?php
/**
 * FileName: Code.php
 * Author: Fei.Song
 * Date: 2021/5/4 22:41
 * Created by PhpStorm
 * Desc:
 */

namespace App\Models;

class Code extends BaseModel {
    protected $table = 'code';

    public function items() {
        return $this->hasMany('App\Models\CodeItem', 'code_id', 'id')->orderBy('sort')->get(['name', 'value', 'description'])->keyBy('value');
    }
}